﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AFT.Parking.Foundation.Calculate
{
    public class Distance
    {
        /// <summary>
        /// 计算两点之间的距离
        /// </summary>
        /// <param name="startPoint"></param>
        /// <param name="endPoint"></param>
        /// <returns></returns>
        public static double GetDistanceOfPoint(Point startPoint, Point endPoint)
        {
            return GetDistanceOfPoint(startPoint.X, startPoint.Y, endPoint.X, endPoint.Y);
        }

        public static double GetDistanceOfPoint(double startX, double startY, double endX, double endY)
        {
            var v = Math.Pow(startX - endX, 2) + Math.Pow(startY - endY, 2);
            return Math.Sqrt(v);
        }
    }
}
